﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TextMining;

namespace HierarchicalClustering
{
    public class Cluster
    {
        public LinkedList<Document> Documents { private set; get; }  // cluster's documents
        public int Number { private set; get; }   // number of cluster

        public Cluster ( int number, Document document )
        {
            Number = number;
            Documents = new LinkedList<Document>();
            Documents.AddLast ( document );   // add the first document
        }

        public void Merge ( Cluster cluster )   // merges 2 clusters
        {
            foreach ( Document document in cluster.Documents )  // merge documents
            {
                Documents.AddLast ( document );
            }

            cluster.Documents.Clear();
        }
        
    }
}
